import myAxios from '@/request.js'

export const uploadPicture = (params) => {
  return myAxios.request({
    url: '/api/picture/upload',
    method: 'post',
    data: params,
  })
}

export const getTagsAndCategory = () => {
  return myAxios.request({
    url: '/api/picture/tagcategory',
    method: 'get',
  })
}

export const updatePicture = (params) => {
  return myAxios.request({
    url: '/api/picture/update',
    method: 'post',
    data: params,
  })
}

/**
 * 仅管理员可用分页查询接口
 * @param params
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const getPicturePages = (params) => {
  return myAxios.request({
    url: '/api/picture/getpages',
    method: 'post',
    data: params,
  })
}

export const getPicturePageVOs = (params) => {
  return myAxios.request({
    url: '/api/picture/getpagesvo',
    method: 'post',
    data: params,
  })
}

export const getbypicturevoid = (params) => {
  return myAxios.request({
    url: '/api/picture/getbypicturevoid',
    method: 'post',
    params,
  })
}
export const deletePictureByid = (params) => {
  return myAxios.request({
    url: '/api/picture/delete',
    method: 'post',
    data: params,
  })
}
